package cn.gson.oasys.services.inform.impl;

import cn.gson.oasys.model.dao.informdao.InformRelationDao;
import cn.gson.oasys.model.entity.notice.NoticeUserRelation;
import cn.gson.oasys.model.entity.user.User;
import cn.gson.oasys.services.inform.InformRelationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
@Transactional
public class InformRelationServiceImpl implements InformRelationService {

    @Autowired
    private InformRelationDao informRelationdao;

    //记日志
    Logger log = LoggerFactory.getLogger(getClass());

    // 保存一个通知到通知与联系人表中
    public NoticeUserRelation save(NoticeUserRelation noticeRelation) {
        return informRelationdao.save(noticeRelation);
    }

    @Override
    public List<NoticeUserRelation> findByReadAndUserId(boolean b, User user) {
        return informRelationdao.findByReadAndUserId(b, user);
    }
}
